package com.ziyun.erp.modules.member.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.ziyun.erp.modules.member.entity.UserBaseInfoEntity;
import com.ziyun.erp.modules.member.entity.UserBaseInfoVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 用户基础信息表
 *
 * @author
 * @email
 * @date 2018-08-01 09:31:39
 */
public interface UserBaseInfoDao extends BaseMapper<UserBaseInfoEntity> {

    List<Map<String, Object>> selectAllList(Map<String, Object> params);

    int getTotalCount(Map<String, Object> params);

    //页面会员列表
    List<UserBaseInfoVO> getAllUserInfo(Pagination page, Map<String, Object> map);
    List<UserBaseInfoVO> getAllUserInfoMall(Pagination page, Map<String, Object> map);

    Map<String, Object> selectByIda(Integer memberId);

    int updateUserBaseInfo(UserBaseInfoEntity userBaseInfo);

    int deleteUser(String[] array);

    List<String> getMobileByDays(int days);

    List<Map<Integer, String>> queryMemberNameList(@Param("memberIdList") Set<Integer> memberIdList);

    UserBaseInfoEntity selectReferralsMember(Integer memberId);

    Integer getCountByIds(@Param("ids") String[] ids);

    //根据用户名查询是否已经存在
    Integer getByName(String name);

    //查询某会员等级的人数
//    @Select("SELECT COUNT(1) FROM user_base_info a LEFT JOIN user_level b USING(user_id) WHERE b.user_lv_id IN (#{param})")
    Integer count(@Param("split") String[] split);
}
